package cn.huoyingkeji.mybitisplus.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.yulichang.base.MPJBaseMapper;

import cn.huoyingkeji.common.domain.DTO;
import cn.huoyingkeji.common.service.BaseService;
import jakarta.validation.constraints.NotEmpty;

import java.util.List;

public interface MybatisplusService<M extends MPJBaseMapper<T>,T, D extends DTO> extends IService<T> ,BaseService<D>{

    /**
     * 转成实体对象
     * @param d
     * @return
     */
    T toEntity(D d);

    /**
     * 转成DTO
     * @param t
     * @return
     */
    D toDTO(T t);
    /**
     * 逻辑删除
     * @param ids
     * @return
     */
    boolean deleteLogic(@NotEmpty List<Long> ids);

    boolean changeStatus(@NotEmpty List<Long> ids, Integer status);
}
